import React, { useEffect } from 'react'
import EchartForReact from 'echarts-for-react'

import theme from '../../../../style/theme/echarts-theme'

const NumChart = props => {

    const { id } = props

    useEffect(() => {
        console.log("update-->", id)
    }, null)

    function getOption() {
        let option = {
            title: {
                text: "总调用次数"
            },
            tooltip: {
                formatter: '{a} <br/>{b} : {c}%'
            },
            series: [{
                name: 'Pressure',
                type: 'gauge',
                radius: '70%',
                detail: {
                    formatter: '{value}'
                },
                data: [{
                    value: 50,
                    name: 'SCORE'
                }]
            }]
        }
        return option
    }

    return (
        <div>
            <EchartForReact
                option={getOption()}
                theme={theme}
            />
        </div>
    )
}

export default NumChart